package xdu.ble.alarm.api;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import xdu.ble.alarm.entity.Alarm;

/**
 * @Author com.alibaba.lizhen
 * @Date 2021/5/28 8:13 下午
 * @Version 1.0
 * @Description
 */
@RequestMapping("alarm/")
public interface AlarmApi {

    @RequestMapping(value = "/active",consumes = "application/json")
    boolean register(Alarm alarm);

    /**
     * 根据报警器id查询报警器信息
     *
     * @return Result
     */
    @RequestMapping(value = "/find")
    Alarm findAlarmByAlarmId(@RequestParam("alarmId") String alarmId);

    /**
     * 根据nbDeviceId查询报警器信息
     *
     * @return Result
     */
    @RequestMapping(value = "/findByDeviceId")
    Alarm findAlarmByNbDeviceId(@RequestParam("nbDeviceId")String nbDeviceId);

    /**
     * 根据报警设备id查看信息
     *
     * @return Result
     */
    @RequestMapping(value = "/update",consumes = "application/json")
    boolean updateAlarmInfo(Alarm alarm);

    /**
     * 解除警报
     *
     * @return Result
     */
    @RequestMapping(value = "/release")
    boolean releaseAlarm(@RequestParam("alarmId") String alarmId);
}
